package com.aiyige.utils.widget;

import android.content.Context;
import android.support.annotation.AttrRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;

/**
 * Created by zhuyakun on 2017/11/27.
 */

public class AutoRefreshCommonDataView extends CommonDataView {
    Callback callback = null;

    public Callback getCallback() {
        return callback;
    }

    public void setCallback(Callback callback) {
        this.callback = callback;
    }

    public AutoRefreshCommonDataView(@NonNull Context context) {
        super(context);
    }

    public AutoRefreshCommonDataView(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public AutoRefreshCommonDataView(@NonNull Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public void clearRequestState() {
        super.clearRequestState();
        if (callback != null) {
            callback.onClearRequestState();
        }
    }

    public interface Callback {
        void onClearRequestState();
    }
}
